<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Gets number of affected rows in last query</title>
 </head>
 <body class="docs"><div id="layout">
  <div id="layout-content"><div id="function.sybase-affected-rows" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">sybase_affected_rows</h1>
  <p class="verinfo">(PHP 4, PHP 5)</p><p class="refpurpose"><span class="refname">sybase_affected_rows</span> &mdash; <span class="dc-title">Gets number of affected rows in last query</span></p>

 </div>

 <div id="function.sybase-affected-rows-refsynopsisdiv">
   <div class="warning"><strong class="warning">Warning</strong><p class="simpara">This function was
<em class="emphasis">REMOVED</em> in PHP 7.0.0.</p></div>
 </div>

 
 <div class="refsect1 description" id="refsect1-function.sybase-affected-rows-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>sybase_affected_rows</strong></span>
    ([ <span class="methodparam"><span class="type">resource</span> <code class="parameter">$link_identifier</code></span>
  ] ) : <span class="type">int</span></div>

  <p class="para rdfs-comment">
   <span class="function"><strong>sybase_affected_rows()</strong></span> returns the number of
   rows affected by the last INSERT, UPDATE or DELETE query on the
   server associated with the specified link identifier.  
  </p>
  <p class="para">
   This command is not effective for SELECT statements, only on
   statements which modify records. To retrieve the number of rows
   returned from a SELECT, use <span class="function"><a href="sybase_num_rows.html" class="function">sybase_num_rows()</a></span>.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.sybase-affected-rows-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>

    
     <dt>
<code class="parameter">link_identifier</code></dt>

     <dd>

      <p class="para">
       If the link identifier isn&#039;t specified, the last opened link is assumed.
      </p>
     </dd>

    
   </dl>

  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.sybase-affected-rows-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   Returns the number of affected rows, as an integer.
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-function.sybase-affected-rows-examples">
  <h3 class="title">范例</h3>
  <p class="para">
   <div class="example" id="example-2593">
    <p><strong>Example #1 Delete-Query</strong></p>
    <div class="example-contents">
<div class="phpcode"><pre><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br /></span><span style="color: #FF8000">/*&nbsp;connect&nbsp;to&nbsp;database&nbsp;*/<br /></span><span style="color: #0000BB">sybase_connect</span><span style="color: #007700">(</span><span style="color: #DD0000">'SYBASE'</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">''</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">''</span><span style="color: #007700">)&nbsp;or<br />die(</span><span style="color: #DD0000">"Could&nbsp;not&nbsp;connect"</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">sybase_select_db</span><span style="color: #007700">(</span><span style="color: #DD0000">"db"</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">sybase_query</span><span style="color: #007700">(</span><span style="color: #DD0000">"DELETE&nbsp;FROM&nbsp;sometable&nbsp;WHERE&nbsp;id&nbsp;&lt;&nbsp;10"</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">printf</span><span style="color: #007700">(</span><span style="color: #DD0000">"Records&nbsp;deleted:&nbsp;%d\n"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">sybase_affected_rows</span><span style="color: #007700">());<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</pre></div>
    </div>

    <div class="example-contents"><p>以上例程会输出：</p></div>
    <div class="example-contents screen">
<div class="cdata"><pre>
Records deleted: 10
</pre></div>
    </div>
   </div>
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.sybase-affected-rows-seealso">
  <h3 class="title">参见</h3>
  <p class="para">
   <ul class="simplelist">
    <li class="member"><span class="function"><a href="sybase_num_rows.html" class="function" rel="rdfs-seeAlso">sybase_num_rows()</a> - Get number of rows in a result set</span></li>
   </ul>
  </p>
 </div>


</div></div></div></body></html>